<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>锁厂广告上架</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
    <meta name="renderer" content="webkit">
    <link href="${pageContext.request.contextPath}/static/css/common.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/static/plugins/bootstrap-3.3.5/css/bootstrap.min.css"
          rel="stylesheet">
    <link href="${pageContext.request.contextPath}/static/plugins/font-awesome-4.3.0/css/font-awesome.min.css"
          rel="stylesheet">
    <!-- jqgrid-->
    <link href="${pageContext.request.contextPath}/static/plugins/select2-4.0.0/dist/css/select2.min.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/static/plugins/jqGrid/css/custom.ui.jqgrid.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/static/plugins/layer/skin/layer.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/static/plugins/jqGrid/css/style.css" rel="stylesheet">
 	<link rel="stylesheet" href="${pageContext.request.contextPath}/static/plugins/jquery.time/jquery.timepicker.min.css">
    <script src="${pageContext.request.contextPath}/static/js/jquery-1.11.3.min.js"></script>
    <script src="/static/plugins/bootstrap-3.3.5/js/bootstrap.min.js"></script>
    <script src="${pageContext.request.contextPath}/static/plugins/layer/layer.js" type="text/javascript"></script>
    <script src="${pageContext.request.contextPath}/static/js/jquery.form.js" type="text/javascript"></script>
    <script src="${pageContext.request.contextPath}/static/plugins/My97DatePicker/WdatePicker.js"
        type="text/javascript"></script>
    <script src="${pageContext.request.contextPath}/static/plugins/select2-4.0.0/dist/js/select2.min.js"></script>
	<script src="${pageContext.request.contextPath}/static/plugins/jquery.time/jquery.timepicker.min.js"
        type="text/javascript"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath}/static/js/global.js"></script>
</head>
<body>
<div class="col-sm-12">
    <form class="form-horizontal m-t" method="post" id="form"
          action="${pageContext.request.contextPath}/admin/bannerResource_addLockBanner.action" enctype="multipart/form-data">
        <input type="hidden" name="size" value="${size}"/>
        <div class="form-group">
            <label class="col-sm-3 control-label"><i class="require">*</i>资源名称:</label>
            <div class="col-sm-8">
                <input class="form-control" name="cName" size="30"/>
            </div>
        </div>
        <div class="form-group" id="mTypeDiv">
            <label class="col-sm-3 col-sm-3 control-label"><i class="require">*</i>上传资源:</label>
            <div class="col-sm-8">
                <div class="input-group">
                    <input class="form-control" name="content" readonly size="30"/>
                    <div class="input-group-addon upload">
                        <input class="form-control" id="upload" type="file" name="upload"
                               style="position: absolute;width: 60px;opacity: 0;"/>
                        <a class="btn btn-primary">上传</a>
                    </div>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 col-sm-3 control-label">URL:</label>
            <div class="col-sm-8">
                <input class="form-control" name="cUrl" id="cUrl" size="30"/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label"><i class="require">*</i>优先级:</label>
            <div class="col-sm-8">
                <select name="priority" id="priority" class="select2">
                    <option value="1">1</option>
                    <option value="2">2</option>
                    <option value="3">3</option>
                    <option value="4">4</option>
                    <option value="5">5</option>
                    <option value="6">6</option>
                    <option value="7">7</option>
                    <option value="8">8</option>
                    <option value="9">9</option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3  control-label"><i class="require">*</i>显示日期:</label>
            <div class="col-sm-8">
                <div class="input-group">
                    <input class="inputWhite form-control col-md-1" name="timeFrom" id='timeFrom' readonly
                           onclick='WdatePicker()'/>
                    <div class="input-group-addon">至</div>
                    <input name='timeTo' id='timeTo' readonly
                           class="inputWhite form-control col-md-1" onclick='WdatePicker()'/>
                </div>
            </div>
        </div>
        
        <div class="form-group">
            <label class="col-sm-3 col-sm-3 control-label">上架人:</label>
            <div class="col-sm-8">
            	<input class="form-control" name="operator" size="30" value="${sessionScope.user.uname}" disabled="disabled"/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 col-sm-3 control-label">上架时间:</label>
            <div class="col-sm-8">
            	<input class="form-control" name="cTime" size="30" id="cTime" disabled="disabled"/>
            </div>
        </div>
    </form>
</div>
<script>
    $(function () {
    	var date = new Date();
        var seperator1 = "-";
        var year = date.getFullYear()+10;
        var month = date.getMonth() + 1;
        var strDate = date.getDate();
        if (month >= 1 && month <= 9) {
            month = "0" + month;
        }
        if (strDate >= 0 && strDate <= 9) {
            strDate = "0" + strDate;
        }
        var currentdate2 = year + seperator1 + month + seperator1 + strDate;
    	$("#cTime").val(curDateTime);
    	$("#timeFrom").val(curDateTime);
    	$("#timeTo").val(currentdate2);
    	$("#priority").val(1);
    	$(".select2").select2({
            minimumResultsForSearch: -1,
            width:'100%'
        });
        $("#upload").change(function () {
            var filename = $(this).val();
            var index = filename.lastIndexOf("\\");
            $("input[name='content']").val(filename.substring(index + 1));
        });
    });
    
</script>
</body>
</html>
